<!--发货单-->
<template>
    <div>
        <el-form label-width="100px" :inline="true" class="formsdre jichu">
            <div v-for="(sd,idx) in searchView" class="f_b">
                <el-form-item :label="sd.label+'：'" v-if="sd.type==0">
                    <el-input v-model="csk[sd.prop]"></el-input>
                </el-form-item>
                <el-form-item :label="sd.label+'：'" v-if="sd.type==1">
                    <zhqcComboBox :label="sd.label" :urls="sd.url" :stair="csk" :second="sd.prop" :parameter="sd.parameter"></zhqcComboBox>
                </el-form-item>
                <el-form-item :label="sd.label+'：'" v-if="sd.type==2">
                    <el-date-picker type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="getdaterange(sd.prop)" v-model="jknmxe">
                    </el-date-picker>
                </el-form-item>
            </div>
            <el-form-item>
                <div class="jjnnjxet">
                    <el-button type="primary" class="ml10" icon="el-icon-search" @click="chaxun">查询</el-button>
                    <el-button type="warning" class="ml10" icon="el-icon-refresh-right" @click="congzhibtn">重置</el-button>
                </div>
            </el-form-item>
        </el-form>
        <zhqcTable :tableData="tableData" :loading="loading" :clientHeight="clientHeight" :TableView="TableView" :total="total" @sizechange="sizechange" @currentChange="currentChange"></zhqcTable>
    </div>
</template>
<script>
    import zhqcComboBox from '@/components/zhqcComboBox'
    import zhqcTable from '@/components/zhqcTable'
    import {
        searchView,
        TableView
    } from './js/DataManipulationView'
    import mixins from '@/mixins'
    export default {
        data() {
            return {
                jknmxe: '',
                csk: {
                    page: 1,
                    limit: 20
                },
                iszj: true
            }
        },
        components: {
            zhqcComboBox,
            zhqcTable
        },
        mixins: [mixins.tableCz],
        computed: {
            clientHeight() {
                return this.$store.state.clientHeight;
            },
            TableView() {
                return TableView
            },
            searchView() {
                return searchView
            }
        },
        methods: {
            chaxun() {
                this.getlist()
            },
            getdaterange(a) {
                let times = a.split(",")
                this.csk[times[0]] = this.time_c(this.jknmxe[0])
                this.csk[times[1]] = this.time_c(this.jknmxe[1])
            }
        },
        mounted() {
            this.searchView.map(a => {
                if (a.type == 2) {
                    let times = a.prop.split(",")
                    this.$set(this.csk, times[0], '');
                    this.$set(this.csk, times[1], '');
                } else {
                    this.$set(this.csk, a.prop, '');
                }
            })

        }
    }

</script>
<style scoped>

</style>
